#pragma once

#include<stdio.h>

#define MAX 1024
//位图
#define NONE_FLUSH (1<<0) //无缓冲
#define LINE_FLUSH (1<<1) //行缓冲
#define FULL_FLUSH (1<<2) //全缓冲

typedef struct TO_FILE
{
    int fileno;
    int flag;
    char outbuffer[MAX];
    int bufferlen;
    int flush_method;
}MyFile;

MyFile *BuyFile(int fd,int flag);
MyFile *MyFopen(const char *path,const char *mode);
void MyFclose(MyFile *);
int MyFwrite(MyFile*,void *str,int len);
void MyFFlush(MyFile *);

